<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Category extends CI_Controller {
    
    function __construct() {
        parent::__construct();
        $this->load->model('novel_model');
        $this->load->model('category_model');
    }
    
    public function index() {
        
    }
    
    public function get_by_category() {
        $slug = $this->uri->segment(2);
        $cate = $this->category_model->getCategory_bySlug($slug);
        $novels = $this->novel_model->getNovel_by_category($cate->id);
        
        $this->load->view('header', array('menu_list' => true, 'pageName' => 'pageList'));
        $this->load->view('list', array('allNovel' => $novels));
        $this->load->view('sidebar');
        $this->load->view('footer');
    }
    
    
}
